package practicados;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Ricardo Yepes
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            Person person = new Person(555, "AAA", "BBB", 88);
            person.setBirthDate(new java.util.Date());
            PersonDAO dao = PersonDAO.getInstance();
            dao.save(person);
            System.out.println(dao.read(person.getIdentity()));
            person.setName("ZZZ");
            dao.update(person);
            System.out.println(dao.read(person.getIdentity()));
            dao.delete(person);
        } catch (SQLException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}
